log using COUNTRIES_STATISTICS , replace
qui{
/**********************/
/*Clean and set memory*/
/**********************/
clear all
set matsize 5000
set more off

/******************/
/*Install programs*/
/******************/

/*********************/
/*Sets base directory*/
/*********************/
global project "D:\IMF_INE_2_2021"  /* Set base directory                         */

/***************************************/
/*Analysis of propensity to participate in an IMF program*/
/***************************************/
use "$project/imf_ehii_code.dta"
xtset ccode1 year
gen high=.
replace high=1 if cname=="Andorra"
replace high=1 if cname=="Antigua and Barbuda"
replace high=1 if cname=="Aruba"
replace high=1 if cname=="Australia"
replace high=1 if cname=="Austria"
replace high=1 if cname=="Bahamas, The"
replace high=1 if cname=="Bahrain"
replace high=1 if cname=="Barbados"
replace high=1 if cname=="Belgium"
replace high=1 if cname=="Bermuda"
replace high=1 if cname=="British Virgin Islands"
replace high=1 if cname=="Brunei Darussalam"
replace high=1 if cname=="Canada"
replace high=1 if cname=="Cayman Islands"
replace high=1 if cname=="Channel Islands"
replace high=1 if cname=="Chile"
replace high=1 if cname=="Croatia"
replace high=1 if cname=="Curacao"
replace high=1 if cname=="Cyprus"
replace high=1 if cname=="Czech Republic"
replace high=1 if cname=="Denmark"
replace high=1 if cname=="Estonia"
replace high=1 if cname=="Faroe Islands"
replace high=1 if cname=="Finland"
replace high=1 if cname=="France"
replace high=1 if cname=="French Polynesia"
replace high=1 if cname=="Germany"
replace high=1 if cname=="Gibraltar"
replace high=1 if cname=="Greece"
replace high=1 if cname=="Greenland"
replace high=1 if cname=="Guam"
replace high=1 if cname=="Hong Kong SAR, China"
replace high=1 if cname=="Hungary"
replace high=1 if cname=="Iceland"
replace high=1 if cname=="Ireland"
replace high=1 if cname=="Isle of Man"
replace high=1 if cname=="Israel"
replace high=1 if cname=="Italy"
replace high=1 if cname=="Japan"
replace high=1 if cname=="Korea, Rep."
replace high=1 if cname=="Kuwait"
replace high=1 if cname=="Latvia"
replace high=1 if cname=="Liechtenstein"
replace high=1 if cname=="Lithuania"
replace high=1 if cname=="Luxembourg"
replace high=1 if cname=="Macao SAR, China"
replace high=1 if cname=="Malta"
replace high=1 if cname=="Monaco"
replace high=1 if cname=="Nauru"
replace high=1 if cname=="Netherlands"
replace high=1 if cname=="New Caledonia"
replace high=1 if cname=="New Zealand"
replace high=1 if cname=="Northern Mariana Islands"
replace high=1 if cname=="Norway"
replace high=1 if cname=="Oman"
replace high=1 if cname=="Palau"
replace high=1 if cname=="Poland"
replace high=1 if cname=="Portugal"
replace high=1 if cname=="Puerto Rico"
replace high=1 if cname=="Qatar"
replace high=1 if cname=="San Marino"
replace high=1 if cname=="Saudi Arabia"
replace high=1 if cname=="Seychelles"
replace high=1 if cname=="Singapore"
replace high=1 if cname=="Sint Maarten (Dutch part)"
replace high=1 if cname=="Slovak Republic"
replace high=1 if cname=="Slovenia"
replace high=1 if cname=="Spain"
replace high=1 if cname=="St. Kitts and Nevis"
replace high=1 if cname=="St. Martin (French part)"
replace high=1 if cname=="Sweden"
replace high=1 if cname=="Switzerland"
replace high=1 if cname=="Trinidad and Tobago"
replace high=1 if cname=="Turks and Caicos Islands"
replace high=1 if cname=="United Arab Emirates"
replace high=1 if cname=="United Kingdom"
replace high=1 if cname=="United States"
replace high=1 if cname=="Uruguay"
replace high=1 if cname=="Virgin Islands (U.S.)"

drop if high==1
rename ehii y 
}
//Developing countries (Low- and Middle-Income Countries based on the World Bank’s 2021 categorization) in the sample [APPENDIX TABLE A1]
tab cname if  imf_all!=. // 135 developing countries = total of 6,737 obs

//Summary statistics [APPENDIX TABLE A2 - Developing countries]
sum y imf_all prgf5 // variables: EHII index, IMF program participation, IMF concessional program

preserve
qui{
/* Create IMF program participation (non-concessional) variable */
gen nocon = sba5+ eff5+ esf5+ fcl5+ pcl5+ saf55 if!missing(sba5, eff5, esf5, fcl5, pcl5, saf55)
replace nocon=1 if nocon>=1 & nocon!=. 
}
sum nocon // variable: IMF non-concessional program
restore

preserve
qui{
/**********************/
/*Clean and set memory*/
/**********************/
clear all
set matsize 5000
set more off

/******************/
/*Install programs*/
/******************/
/*
cap ssc install xtabond2 
cap ssc install xtivreg2 
cap ssc install spmat 
cap ssc install spmack
*/
/*********************/
/*Sets base directory*/
/*********************/
global project "D:\IMF_INE_2_2021"  /* Set base directory                         */

local  repsBS=100                                                                           /* Number of bootstrap repetitions            */

/****************************/
/*Create anxillary variables*/
/****************************/

use "$project/imf_ehii_CONDITIONS_code.dta"
xtset ccode1 year
rename ehii y 

/*Drop high-income countries*/
gen high=.
replace high=1 if cname=="Andorra"
replace high=1 if cname=="Antigua and Barbuda"
replace high=1 if cname=="Aruba"
replace high=1 if cname=="Australia"
replace high=1 if cname=="Austria"
replace high=1 if cname=="Bahamas, The"
replace high=1 if cname=="Bahrain"
replace high=1 if cname=="Barbados"
replace high=1 if cname=="Belgium"
replace high=1 if cname=="Bermuda"
replace high=1 if cname=="British Virgin Islands"
replace high=1 if cname=="Brunei Darussalam"
replace high=1 if cname=="Canada"
replace high=1 if cname=="Cayman Islands"
replace high=1 if cname=="Channel Islands"
replace high=1 if cname=="Chile"
replace high=1 if cname=="Croatia"
replace high=1 if cname=="Curacao"
replace high=1 if cname=="Cyprus"
replace high=1 if cname=="Czech Republic"
replace high=1 if cname=="Denmark"
replace high=1 if cname=="Estonia"
replace high=1 if cname=="Faroe Islands"
replace high=1 if cname=="Finland"
replace high=1 if cname=="France"
replace high=1 if cname=="French Polynesia"
replace high=1 if cname=="Germany"
replace high=1 if cname=="Gibraltar"
replace high=1 if cname=="Greece"
replace high=1 if cname=="Greenland"
replace high=1 if cname=="Guam"
replace high=1 if cname=="Hong Kong SAR, China"
replace high=1 if cname=="Hungary"
replace high=1 if cname=="Iceland"
replace high=1 if cname=="Ireland"
replace high=1 if cname=="Isle of Man"
replace high=1 if cname=="Israel"
replace high=1 if cname=="Italy"
replace high=1 if cname=="Japan"
replace high=1 if cname=="Korea, Rep."
replace high=1 if cname=="Kuwait"
replace high=1 if cname=="Latvia"
replace high=1 if cname=="Liechtenstein"
replace high=1 if cname=="Lithuania"
replace high=1 if cname=="Luxembourg"
replace high=1 if cname=="Macao SAR, China"
replace high=1 if cname=="Malta"
replace high=1 if cname=="Monaco"
replace high=1 if cname=="Nauru"
replace high=1 if cname=="Netherlands"
replace high=1 if cname=="New Caledonia"
replace high=1 if cname=="New Zealand"
replace high=1 if cname=="Northern Mariana Islands"
replace high=1 if cname=="Norway"
replace high=1 if cname=="Oman"
replace high=1 if cname=="Palau"
replace high=1 if cname=="Poland"
replace high=1 if cname=="Portugal"
replace high=1 if cname=="Puerto Rico"
replace high=1 if cname=="Qatar"
replace high=1 if cname=="San Marino"
replace high=1 if cname=="Saudi Arabia"
replace high=1 if cname=="Seychelles"
replace high=1 if cname=="Singapore"
replace high=1 if cname=="Sint Maarten (Dutch part)"
replace high=1 if cname=="Slovak Republic"
replace high=1 if cname=="Slovenia"
replace high=1 if cname=="Spain"
replace high=1 if cname=="St. Kitts and Nevis"
replace high=1 if cname=="St. Martin (French part)"
replace high=1 if cname=="Sweden"
replace high=1 if cname=="Switzerland"
replace high=1 if cname=="Trinidad and Tobago"
replace high=1 if cname=="Turks and Caicos Islands"
replace high=1 if cname=="United Arab Emirates"
replace high=1 if cname=="United Kingdom"
replace high=1 if cname=="United States"
replace high=1 if cname=="Uruguay"
replace high=1 if cname=="Virgin Islands (U.S.)"

drop if high==1
/* Create IMF program participation variable based on IMF binding conditions (above mean [=8.198454]) */
drop if imf_all==.
drop if BA2TOT==.
}

sum BA2TOT // Number of binding conditions: mean=8.198454
gen imf_all_con=0
replace imf_all_con=1 if imf_all==1 & BA2TOT>=8.198454
sum imf_all_con // variable: IMF program, many conditions
restore

preserve
qui{
/**********************/
/*Clean and set memory*/
/**********************/
clear all
set matsize 5000
set more off

/******************/
/*Install programs*/
/******************/
/*
cap ssc install xtabond2 
cap ssc install xtivreg2 
cap ssc install spmat 
cap ssc install spmack
*/
/*********************/
/*Sets base directory*/
/*********************/
global project "D:\IMF_INE_2_2021"  /* Set base directory                         */

local  repsBS=100                                                                           /* Number of bootstrap repetitions            */

/****************************/
/*Create anxillary variables*/
/****************************/

use "$project/imf_ehii_CONDITIONS_code.dta"
xtset ccode1 year
rename ehii y 

/*Drop high-income countries*/
gen high=.
replace high=1 if cname=="Andorra"
replace high=1 if cname=="Antigua and Barbuda"
replace high=1 if cname=="Aruba"
replace high=1 if cname=="Australia"
replace high=1 if cname=="Austria"
replace high=1 if cname=="Bahamas, The"
replace high=1 if cname=="Bahrain"
replace high=1 if cname=="Barbados"
replace high=1 if cname=="Belgium"
replace high=1 if cname=="Bermuda"
replace high=1 if cname=="British Virgin Islands"
replace high=1 if cname=="Brunei Darussalam"
replace high=1 if cname=="Canada"
replace high=1 if cname=="Cayman Islands"
replace high=1 if cname=="Channel Islands"
replace high=1 if cname=="Chile"
replace high=1 if cname=="Croatia"
replace high=1 if cname=="Curacao"
replace high=1 if cname=="Cyprus"
replace high=1 if cname=="Czech Republic"
replace high=1 if cname=="Denmark"
replace high=1 if cname=="Estonia"
replace high=1 if cname=="Faroe Islands"
replace high=1 if cname=="Finland"
replace high=1 if cname=="France"
replace high=1 if cname=="French Polynesia"
replace high=1 if cname=="Germany"
replace high=1 if cname=="Gibraltar"
replace high=1 if cname=="Greece"
replace high=1 if cname=="Greenland"
replace high=1 if cname=="Guam"
replace high=1 if cname=="Hong Kong SAR, China"
replace high=1 if cname=="Hungary"
replace high=1 if cname=="Iceland"
replace high=1 if cname=="Ireland"
replace high=1 if cname=="Isle of Man"
replace high=1 if cname=="Israel"
replace high=1 if cname=="Italy"
replace high=1 if cname=="Japan"
replace high=1 if cname=="Korea, Rep."
replace high=1 if cname=="Kuwait"
replace high=1 if cname=="Latvia"
replace high=1 if cname=="Liechtenstein"
replace high=1 if cname=="Lithuania"
replace high=1 if cname=="Luxembourg"
replace high=1 if cname=="Macao SAR, China"
replace high=1 if cname=="Malta"
replace high=1 if cname=="Monaco"
replace high=1 if cname=="Nauru"
replace high=1 if cname=="Netherlands"
replace high=1 if cname=="New Caledonia"
replace high=1 if cname=="New Zealand"
replace high=1 if cname=="Northern Mariana Islands"
replace high=1 if cname=="Norway"
replace high=1 if cname=="Oman"
replace high=1 if cname=="Palau"
replace high=1 if cname=="Poland"
replace high=1 if cname=="Portugal"
replace high=1 if cname=="Puerto Rico"
replace high=1 if cname=="Qatar"
replace high=1 if cname=="San Marino"
replace high=1 if cname=="Saudi Arabia"
replace high=1 if cname=="Seychelles"
replace high=1 if cname=="Singapore"
replace high=1 if cname=="Sint Maarten (Dutch part)"
replace high=1 if cname=="Slovak Republic"
replace high=1 if cname=="Slovenia"
replace high=1 if cname=="Spain"
replace high=1 if cname=="St. Kitts and Nevis"
replace high=1 if cname=="St. Martin (French part)"
replace high=1 if cname=="Sweden"
replace high=1 if cname=="Switzerland"
replace high=1 if cname=="Trinidad and Tobago"
replace high=1 if cname=="Turks and Caicos Islands"
replace high=1 if cname=="United Arab Emirates"
replace high=1 if cname=="United Kingdom"
replace high=1 if cname=="United States"
replace high=1 if cname=="Uruguay"
replace high=1 if cname=="Virgin Islands (U.S.)"

drop if high==1
/* Create IMF program participation variable based on IMF binding conditions (above mean [=8.198454]) */
drop if imf_all==.
drop if BA2TOT==.
}
sum BA2TOT // Number of binding conditions: mean=8.198454
gen imf_all_con=0
replace imf_all_con=1 if imf_all==1 & BA2TOT<8.198454
sum imf_all_con // variable: IMF program, few conditions
restore


********************************************************************************

qui{

/**********************/
/*Clean and set memory*/
/**********************/
clear all
set matsize 5000
set more off

/******************/
/*Install programs*/
/******************/

/*********************/
/*Sets base directory*/
/*********************/
global project "D:\IMF_INE_2_2021"  /* Set base directory                         */

/***************************************/
/*Analysis of propensity to participate in an IMF program*/
/***************************************/
use "$project/imf_ehii_code.dta"
xtset ccode1 year
rename ehii y 

gen high=.
replace high=1 if cname=="Andorra"
replace high=1 if cname=="Antigua and Barbuda"
replace high=1 if cname=="Aruba"
replace high=1 if cname=="Australia"
replace high=1 if cname=="Austria"
replace high=1 if cname=="Bahamas, The"
replace high=1 if cname=="Bahrain"
replace high=1 if cname=="Barbados"
replace high=1 if cname=="Belgium"
replace high=1 if cname=="Bermuda"
replace high=1 if cname=="British Virgin Islands"
replace high=1 if cname=="Brunei Darussalam"
replace high=1 if cname=="Canada"
replace high=1 if cname=="Cayman Islands"
replace high=1 if cname=="Channel Islands"
replace high=1 if cname=="Chile"
replace high=1 if cname=="Croatia"
replace high=1 if cname=="Curacao"
replace high=1 if cname=="Cyprus"
replace high=1 if cname=="Czech Republic"
replace high=1 if cname=="Denmark"
replace high=1 if cname=="Estonia"
replace high=1 if cname=="Faroe Islands"
replace high=1 if cname=="Finland"
replace high=1 if cname=="France"
replace high=1 if cname=="French Polynesia"
replace high=1 if cname=="Germany"
replace high=1 if cname=="Gibraltar"
replace high=1 if cname=="Greece"
replace high=1 if cname=="Greenland"
replace high=1 if cname=="Guam"
replace high=1 if cname=="Hong Kong SAR, China"
replace high=1 if cname=="Hungary"
replace high=1 if cname=="Iceland"
replace high=1 if cname=="Ireland"
replace high=1 if cname=="Isle of Man"
replace high=1 if cname=="Israel"
replace high=1 if cname=="Italy"
replace high=1 if cname=="Japan"
replace high=1 if cname=="Korea, Rep."
replace high=1 if cname=="Kuwait"
replace high=1 if cname=="Latvia"
replace high=1 if cname=="Liechtenstein"
replace high=1 if cname=="Lithuania"
replace high=1 if cname=="Luxembourg"
replace high=1 if cname=="Macao SAR, China"
replace high=1 if cname=="Malta"
replace high=1 if cname=="Monaco"
replace high=1 if cname=="Nauru"
replace high=1 if cname=="Netherlands"
replace high=1 if cname=="New Caledonia"
replace high=1 if cname=="New Zealand"
replace high=1 if cname=="Northern Mariana Islands"
replace high=1 if cname=="Norway"
replace high=1 if cname=="Oman"
replace high=1 if cname=="Palau"
replace high=1 if cname=="Poland"
replace high=1 if cname=="Portugal"
replace high=1 if cname=="Puerto Rico"
replace high=1 if cname=="Qatar"
replace high=1 if cname=="San Marino"
replace high=1 if cname=="Saudi Arabia"
replace high=1 if cname=="Seychelles"
replace high=1 if cname=="Singapore"
replace high=1 if cname=="Sint Maarten (Dutch part)"
replace high=1 if cname=="Slovak Republic"
replace high=1 if cname=="Slovenia"
replace high=1 if cname=="Spain"
replace high=1 if cname=="St. Kitts and Nevis"
replace high=1 if cname=="St. Martin (French part)"
replace high=1 if cname=="Sweden"
replace high=1 if cname=="Switzerland"
replace high=1 if cname=="Trinidad and Tobago"
replace high=1 if cname=="Turks and Caicos Islands"
replace high=1 if cname=="United Arab Emirates"
replace high=1 if cname=="United Kingdom"
replace high=1 if cname=="United States"
replace high=1 if cname=="Uruguay"
replace high=1 if cname=="Virgin Islands (U.S.)"
}
//High-income countries (High-Income Countries based on the World Bank’s 2021 categorization) in the sample [APPENDIX TABLE A3]
tab cname if  imf_all!=. & high==1 // 58 high-income countries = total of 2,900 obs


//Summary statistics [APPENDIX TABLE A2 - All countries]
sum y imf_all // variables: EHII index & IMF program participation

log close

translate COUNTRIES_STATISTICS.smcl COUNTRIES_STATISTICS.pdf